<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $user_id 
 * @property string $username 
 * @property int $type 
 * @property string $content 
 */
class UserCredential extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'user_credential';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['user_id' => 'integer', 'type' => 'integer'];


    public $timestamps = false;

    protected $primaryKey = "username";

    public function user(){
        return $this->hasOne(User::class,"user_id",'user_id');
    }
}